solving complex algebraic equations